#include <stdio.h>
#include <unistd.h>

int main(){
	pid_t fpid;
	int a = 0;
	printf("a=%d\n",a);
	printf("Forking......\n");
	fpid = fork();
	
	if (fpid<0) {
		printf("Error in fork!\n");
	} else if (fpid == 0) {
		a++;
		printf("This is child process, a=%d\n",a);
	} else {
		a++;
		printf("This is parent proess, a=%d\n",a);
	}

	return 0;
}
